<?php

    $email = $_POST['email'];
    $password = $_POST['password'];
    

    $con = mysql_connect('localhost', 'root', 'root');


    mysql_select_db('userlist', $con);

    // $sql = 'SELECT * FROM `loginsql` WHERE `email` =' ."$email". 'AND `password` =' ."$password";
    $sql = 'SELECT * FROM `loginsql` WHERE `email` = "'.$email.'" AND `password` ="'.$password.'"';
    // $sql = 'SELECT `email` FROM `user` WHERE `email`="'.$email.'" AND `password`="'.$password.'"';

    $res = mysql_query($sql);

    $row = mysql_fetch_assoc($res);
    // $row = mysql_fetch_array( $res );

    mysql_close($con);

    if ($row) {
        die('{"type":"success"}');
    } else {
        die('{"type":"error"}');
    }
?>